package com.supor.aiot.common.app.api;

import com.android.baseconfig.base.BaseApiResult;
import com.android.baseconfig.base.DataApiResult;
import com.supor.aiot.common.app.Constants;
import com.supor.aiot.common.entity.BannerInfo;
import com.supor.aiot.common.entity.UserInfo;

import java.util.List;
import java.util.Map;

import io.reactivex.rxjava3.core.Observable;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * ---------------------------------------------------------------- <br>
 * Copyright (C) 2014-2021, by het, Shenzhen, All rights reserved.  <br>
 * ---------------------------------------------------------------- <br>
 * <p>
 * 描述: CommonService <br>
 * 作者: lei <br>
 * 日期: 2021/10/22 <br>
 */
public interface CommonService {

    /**
     * 获取banner(/possTAd/page?adType=APP_BANNER&limit=100)
     *
     * @param limit 1000
     * @param adType 类型：APP_BANNER
     * @return Observable<BaseApiResult<DataApiResult<List<BannerInfo>>>>
     */
    // @FormUrlEncoded
    @GET(Constants.OSS_API + "possTAd/page")
    Observable<BaseApiResult<DataApiResult<List<BannerInfo>>>> getBanner(@QueryMap Map<String, Object> map);


    /**
     * 获取当前菜谱名称
     * @param recipeId 数据点的recipeId，对应的是食谱代码的后四位，要转换成十进制
     * @param mac 电饭煲mac
     * @return recipeName
     */
    @GET(Constants.OSS_API + "foodTRecipe/getRecipe/{recipeId}")
    Observable<BaseApiResult<String>> getRecipe(@Path("recipeId") int recipeId, @Query("mac") String mac);
}
